<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta name="baidu-site-verification" th:content="${@environment.getProperty('baidu.site.verification')}"  />
  <meta name="sogou_site_verification" th:content="${@environment.getProperty('sogou.site.verification')}"/>
  <meta name="baidu_union_verify" th:content="${@environment.getProperty('baidu.union.verify')}">
  <th:block th:insert="~{common/header :: head}"></th:block>
  <link rel="stylesheet" href="/css/community.css">
  <title th:text="${@environment.getProperty('site.main.title')}"></title>
</head>
<body>

<div th:insert="~{common/header :: nav}"></div>

<div th:insert="~{common/header :: sub_nav}"></div>



<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8">
      <div class="fly-panel">
        <div class="fly-panel-title fly-filter">
          <a>欢迎您的到来~</a>
          <!--a href="#signin" class="html5plus-hide layui-hide-sm layui-show-xs-block fly-right" id="LAY_goSignin" style="color: #FF5722;">去签到</a-->
          <a th:if="${loginUser==null}" href="/sso/login" class="layui-hide-sm fly-right html5plus-display" id="LAY_gologin" style="color: #FF5722;display: none">注册/登录</a>
          <a th:if="${loginUser!=null}" class="fly-nav-avatar niter-avatar layui-hide-sm fly-right html5plus-display html5plus-user-icon" id="LAY_goUserCenter" style="color: #FF5722;display: none">
              <!--img th:src="${session.user.avatarUrl}"-->
              <i th:if="${loginUser.vipRank==1}" class="layui-icon fly-list-kiss layui-hide-xs" title="红砖会员等级：LV1">&#xe735</i>
              <cite onclick="javascript:window.open('/user/set/info')" th:class="${loginUser.vipRank==1? 'fly-list-kiss':''}" th:text="${loginUser.name}"></cite>
              <!--span onclick="javascript:window.open('/user/message')" th:if="${session.unreadCount!=0}" class="layui-badge" th:text="${session.unreadCount}"></span-->
          </a>

        </div>
        <ul class="fly-list">
          <li th:each="question : ${topQuestions}">
            <a th:href="${'/user/'+question.user.id}" class="fly-avatar niter-avatar">
              <img th:src="${question.user.avatarUrl}"
                   th:alt="${question.user.name}">
            </a>
            <h2>
              <a class="layui-badge" th:if="${question.column2==1}">提问</a>
              <a class="layui-badge" th:if="${question.column2==2}">分享</a>
              <a class="layui-badge" th:if="${question.column2==3}">建议</a>
              <a class="layui-badge" th:if="${question.column2==4}">讨论</a>
              <a class="layui-badge layui-bg-green" th:if="${question.column2==5}">公告</a>
              <a class="layui-badge" th:if="${question.column2==6}">动态</a>
              <a class="layui-badge" th:if="${question.column2==9}">其它</a>
                <a th:if="${question.permission==10}" class="fly-list-like layui-hide-xs" title="会员尊享"><i class="layui-icon">&#xe735</i></a>
                <a th:href="@{'/p/'+ ${question.id}}" th:text="${question.title}" th:title="${question.title}" target="_blank" th:style="${question.permission==10? 'color:red':''}"></a>
                <a th:if="${question.viewCount>100}" class="fly-list-like layui-hide-xs" title="烫烫烫"><i  class="layui-icon" style="font-size: 20px">&#xe756;</i></a>
            </h2>
            <div class="fly-list-info">
              <a link >
                <i th:if="${question.userAccount.vipRank==1}" class="layui-icon fly-list-kiss" title="红砖会员等级：LV1">&#xe735</i>
                <cite th:class="${question.userAccount.vipRank==1? 'fly-list-kiss':''}" th:text="${question.user.name}"></cite>
                <i class="layui-badge fly-badge-vip layui-bg-gray layui-hide-xs" th:text="${@environment.getProperty('user.group.r'+question.userAccount.groupId)}"></i>
              </a>
              <span th:text="${question.gmtLatestCommentStr}"></span>
              
              <!--span class="fly-list-kiss layui-hide-xs" title="浏览"><i class="iconfont icon-kiss"></i><span th:text="${question.viewCount}"></span></span-->
              <span class="fly-list-like layui-hide-xs" title="收藏"><i class="layui-icon">&#xe600;</i><span th:text="${question.LikeCount}"></span></span>
                <!--span class="layui-badge fly-badge-accept layui-hide-xs">已结</span-->
                <span class="fly-list-nums" >
                <i class="iconfont layui-hide-xs" title="浏览">&#xe60b;</i> <span class="layui-hide-xs" th:text="${question.viewCount}"></span>
                <i class="iconfont icon-pinglun1" title="回复" ></i> <span th:text="${question.commentCount}"></span>
              </span>
            </div>
            <div class="fly-list-badge">

              <span th:if="${question.status==2||question.status==3}" class="layui-badge layui-bg-orange">置顶</span>
            </div>
          </li>

        </ul>
      </div>

      <div class="fly-panel" style="margin-bottom: 0;">
        
        <div class="fly-panel-title fly-filter">
          <a href="/forum" th:class="${sort == 'new' || sort == null ? 'layui-this':''}">综合</a>
          <span class="fly-mid"></span>
          <a th:class="${sort == 'hot7' ? 'layui-this':''}" th:href="@{/forum/(sort='hot7',search=${search},tag=${tag},column=${column})}">周榜</a>
          <span class="fly-mid"></span>
          <a th:class="${sort == 'hot30' ? 'layui-this':''}" th:href="@{/forum/(sort='hot30',search=${search},tag=${tag},column=${column})}">月榜</a>
          <span class="fly-mid"></span>
          <a th:class="${sort == 'good' ? 'layui-this':''}" th:href="@{/forum/(sort='good',search=${search},tag=${tag},column=${column})}">精华</a>
          <span class="fly-filter-right">
            <!--a th:href="@{/t/(sort=${sort},search=${search},tag=${tag},column=${column})}" style="color: red" class="layui-hide-xs"><i class="layui-icon">&#xe636;</i>瀑布流</a-->
            <a class="html5plus-hide" href="javascript:downloadApp()" style="color: red"><i class="layui-icon">&#xe63b;</i>APP</a>
            <span class="fly-mid layui-hide-xs"></span>
            <a th:href="@{/forum/(sort='new',search=${search},tag=${tag},column=${column})}" th:class="${sort == 'new' || sort == null ? 'layui-this layui-hide-xs':'layui-hide-xs'}">按最新</a>
            <span class="fly-mid layui-hide-xs"></span>
            <a th:class="${sort == 'no' ? 'layui-this  layui-hide-xs':' layui-hide-xs'}" th:href="@{/forum/(sort='no',search=${search},tag=${tag},column=${column})}">抢沙发</a>
          </span>
        </div>

        <ul class="fly-list">          
          <li th:each="question : ${pagination.data}">
           <div th:if="${question.status==0||question.status==1}">
            <a th:href="${'/user/'+question.user.id}" class="fly-avatar niter-avatar">
              <img th:src="${question.user.avatarUrl}"
                   th:alt="${question.user.name}">
            </a>
            <h2>
                <a class="layui-badge" th:if="${question.column2==1}">提问</a>
                <a class="layui-badge" th:if="${question.column2==2}">分享</a>
                <a class="layui-badge" th:if="${question.column2==3}">建议</a>
                <a class="layui-badge" th:if="${question.column2==4}">讨论</a>
                <a class="layui-badge layui-bg-green" th:if="${question.column2==5}">公告</a>
                <a class="layui-badge" th:if="${question.column2==6}">动态</a>
                <a class="layui-badge" th:if="${question.column2==9}">其它</a>
                <a th:if="${question.permission==10}" class="fly-list-like layui-hide-xs" title="会员尊享"><i class="layui-icon">&#xe735</i></a>
                <a th:href="@{'/p/'+ ${question.id}}" th:text="${question.title}" th:title="${question.title}" th:style="${question.permission==10? 'color:red':''}"></a>
              <a th:if="${question.viewCount>100}" class="fly-list-like layui-hide-xs" title="烫烫烫"><i  class="layui-icon" style="font-size: 20px">&#xe756;</i></a>
            </h2>
            <div class="fly-list-info">
                <a link >
                    <i th:if="${question.userAccount.vipRank==1}" class="layui-icon fly-list-kiss" title="红砖会员等级：LV1">&#xe735</i>
                    <cite th:class="${question.userAccount.vipRank==1? 'fly-list-kiss':''}" th:text="${question.user.name}"></cite>
                    <i class="layui-badge fly-badge-vip layui-bg-gray layui-hide-xs" th:text="${@environment.getProperty('user.group.r'+question.userAccount.groupId)}"></i>
                </a>
              <span th:text="${question.gmtLatestCommentStr}"></span>

                <!--span class="fly-list-kiss layui-hide-xs" title="浏览"><i class="iconfont icon-kiss"></i><span th:text="${question.viewCount}"></span></span-->
                <span class="fly-list-like layui-hide-xs" title="收藏"><i class="layui-icon">&#xe600;</i><span th:text="${question.LikeCount}"></span></span>
                <!--span class="layui-badge fly-badge-accept layui-hide-xs">已结</span-->
                <span class="fly-list-nums" >
                <i class="iconfont layui-hide-xs" title="浏览">&#xe60b;</i> <span class="layui-hide-xs" th:text="${question.viewCount}"></span>
                <i class="iconfont icon-pinglun1" title="回复" ></i> <span th:text="${question.commentCount}"></span>
              </span>
            </div>
            <div class="fly-list-badge">
              <span th:if="${question.status==1||question.status==3}" class="layui-badge layui-bg-red" >精帖</span>
            </div>
           </div>
          </li>
        </ul>

<div style="text-align: center">
          <div class="laypage-main"  ><!-- 分页展示 -->
                  <a th:if="${pagination.showFirstPage}" th:href="@{/forum/(page=1,search=${search},tag=${tag},sort=${sort},column=${column})}"
                     aria-label="Previous" class="laypage-prev">
                    &laquo;
                  </a>
                  <a th:if="${pagination.showPrevious}" th:href="@{/forum/(page=${pagination.page - 1},search=${search},tag=${tag},sort=${sort},column=${column})}" class="laypage-prev">
                    &lt;
                  </a>
                <th:block th:each="page : ${pagination.pages}" >
                  <a th:if="${pagination.page != page}"
                     th:href="@{/forum/(page=${page},search=${search},tag=${tag},sort=${sort},column=${column})}"
                     th:text="${page}"></a>
                  <span th:if="${pagination.page == page}"
                     th:href="@{/forum/(page=${page},search=${search},tag=${tag},sort=${sort},column=${column})}"
                     th:text="${page}"
                  class="laypage-curr"></span>
                </th:block>
                  <a th:if="${pagination.showNext}" th:href="@{/forum/(page=${pagination.page +1 },search=${search},tag=${tag},sort=${sort},column=${column})}" class="laypage-next">
                    &gt;
                  </a>
                  <a th:if="${pagination.showEndPage}" th:href="@{/forum/(page=${pagination.totalPage},search=${search},tag=${tag},sort=${sort},column=${column})}"
                     aria-label="Next" class="laypage-next">
                   &raquo;
                  </a>

          </div>
</div>

      </div>
    </div>
      <th:block th:insert="~{common/sider :: index}"></th:block>
  </div>
</div>


<!--script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_30088308'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "w.cnzz.com/c.php%3Fid%3D30088308' type='text/javascript'%3E%3C/script%3E"));</script-->
<th:block th:insert="~{common/footer :: foot}"></th:block>
<script>
  layui.cache.page = 'index';
  layui.cache.user = {
    //username: '匿名用户'
    //,uid: -1
    //  ,avatar: '/images/avatar/00.jpg'
    name: '[[${loginUser!=null?loginUser.name:"匿名用户"}]]'
    ,uid: [[${loginUser!=null?loginUser.id:-1}]]
    ,avatar: '[[${loginUser!=null?loginUser.avatarUrl:"/images/avatar/default.png"}]]'
    ,experience: 83
    ,sex: '男'
  };
  layui.config({
    version: "3.0.0"
    ,base: '/mods/'  //这里实际使用时，建议改成绝对路径
  }).extend({
    fly: 'index'
  }).use('fly');
</script>
</body>
</html>